package com.cc.police.service.Impl;

import com.cc.police.entity.PPolice;
import com.cc.police.mapper.PPoliceMapper;
import com.cc.police.service.PPoliceService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class PPoliceServiceImpl implements PPoliceService {
    @Autowired
    PPoliceMapper mapper;


    @Override
    public List<PPolice> getPPoliceByConfirm(String confirm) {
        return mapper.getPPoliceByConfirm(confirm);
    }

    @Override
    public void updateConfirmThreeById(Integer id, String confirm) {
        mapper.updateConfirmThreeById(id,confirm);
    }


    /*搜索功能----车间*/
    @Override
    public List<PPolice> selectByGrups(String groups) {
        return mapper.selectByGroups(groups);
    }

    /*搜索功能----报警级别紧急1重要2一般3*/
    @Override
    public List<PPolice> selectByLevels(String levels) {
        return mapper.selectByLevels(levels);
    }

    /*搜索功能----根据时间查询*/
    @Override
    public List<PPolice> selectByTime(String starttime, String endtime) {
        return mapper.selectByTime(starttime,endtime);
    }

    @Override
    public List<PPolice> selectChartByTime(String starttime, String endtime,String groups) {
        System.out.println(starttime);
        System.out.println(endtime);
        return mapper.selectChartByTime(starttime,endtime,groups);
    }

    @Override
    public List<PPolice> selectByGroups() {
        return mapper.selectByGroupss();
    }


    /*按小时查*/
    @Override
    public List<PPolice> selectCountByHours(String starttime, String endtime,String groups) {
        return mapper.selectCountByHours(starttime,endtime,groups);
    }

    @Override
    public List<PPolice> selectCountByDays(String starttime, String endtime,String groups) {
        return mapper.selectCountByDays(starttime,endtime,groups);
    }


    @Override
    public List<PPolice> showDays(String starttime, String endtime,String groups) {
        return mapper.selectChartByTime(starttime,endtime,groups);

    }

    /*图表功能----饼状图数据报警条数查询*/
    @Override
    public List<PPolice> selectRingByTime(String starttime, String endtime) {
        return mapper.selectRingByTime(starttime,endtime);
    }


}
